Apparatus and method for encoding and decoding image containing gray alpha channel image

ABSTRACT

An apparatus and a method for encoding and/or decoding an image containing a gray alpha channel image. The apparatus for encoding an image includes a block data reception unit receiving image data of a block currently being input to the apparatus and classifies the current block either as a foreground image portion or as a background image portion according to values of gray alpha components in the current block; a foreground image encoding unit sequentially encoding the gray alpha components and brightness and hue components of the current block if the current block is classified as the foreground image portion; and a background image encoding unit encoding the gray alpha components of the current block if the current block is classified as the background image portion. The apparatus for decoding an image includes a bitstream interpretation unit interpreting the bitstream in units of predetermined blocks and classifies a current block obtained as one of the interpretation results either as a foreground image portion or as a background image portion; a foreground image decoding unit generating a restored gray alpha channel image and a restored brightness and hue image by sequentially decoding gray alpha components and brightness and hue components of the current block if the current block is classified as the foreground image portion; and a background image decoding unit generating a restored gray alpha channel image by decoding the gray alpha components of the current block if the current block is classified as the background image portion.

This application claims the benefits of Korean Patent Application Nos.2004-15152, filed on Mar. 5, 2004, and 2005-10855, filed on Feb. 4, 2005in the Korean Intellectual Property Office, the disclosures of which areincorporated herein in their entirety by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to encoding and decoding of image data,and more particularly, to an apparatus and a method for encoding anddecoding an image containing a gray alpha channel image.

2. Description of the Related Art

A gray alpha channel image serves as a mask to select a specific zone ina general image. The ISO/IEC MPEG-4 standard provides a method ofencoding an image in units of objects in which shape information isseparately encoded so that the image is identified in the units of theobjects. The shape information may be considered as a gray alpha channelimage. However, since, in the MPEG-4 standard, the shape information isencoded in a different manner from general images, it is difficult torealize an apparatus for encoding an image containing a gray alphachannel image and to process the shape information in real time due tothe significant amount of calculations required.

According to the H.264/MPEG4 pt. 10 AVC standard technology (“Text ofISO/IEC FDIS 14496-10: Information Technology—Coding of audio-visualobjects—Part 10: Advanced Video Coding”, ISO/IEC JTC 1/SC 29/WG 11,N5555, March, 2003), which has been developed by a Joint Video Team(JVT) of the ISO/IEC MPEG and ITU-T VCEG groups, general image encodingefficiency may be dramatically improved by performing spatial andtemporal prediction encoding in various methods. This standardtechnology uses an enhanced function, integer transform coding, improvesentropy coding efficiency using context adaptive binary arithmeticcoding (CABAC), but fails to provide a method of processing an imagecontaining a gray alpha channel image.

SUMMARY OF THE INVENTION

Aspects of the present invention provide an apparatus and a method forencoding and/or decoding an image containing a gray alpha channel image.

Additional aspects and/or advantages of the invention will be set forthin part in the description which follows and, in part, will be obviousfrom the description, or may be learned by practice of the invention.

According to an aspect of the present invention, there is provided anapparatus for encoding an image including a gray alpha channel image,which encodes an image containing gray alpha components and brightnessand hue components in units of predetermined blocks, the apparatusincluding: a block data reception unit, which receives image data of ablock currently being input to the apparatus and classifies the currentblock either as a foreground image portion or as a background imageportion according to the values of gray alpha components in the currentblock; a foreground image encoding unit, which sequentially encodes thegray alpha components and brightness and hue components of the currentblock if the current block is classified as the foreground imageportion; and a background image encoding unit, which encodes the grayalpha components of the current block if the current block is classifiedas the background image portion.

According to another aspect of the present invention, there is provideda method of encoding an image containing a gray alpha channel image,which encodes an image containing gray alpha components and brightnessand hue components in units of predetermined blocks, the methodincluding: classifying a current block either as a foreground imageportion or as a background image portion according to the values of grayalpha components in the current block; sequentially encoding the grayalpha components and brightness and hue components of the current blockif the current block is classified as the foreground image portion; andencoding the gray alpha components of the current block if the currentblock is classified as the background image portion.

According to another aspect of the present invention, there is providedan apparatus for decoding an image containing a gray alpha channelimage, which decodes a bitstream into which an image containing grayalpha components and brightness and hue components is encoded, theapparatus including: a bitstream interpretation unit, which interpretsthe bitstream in units of predetermined blocks and classifies a currentblock obtained as one of the interpretation results either as aforeground image portion or as a background image portion; a foregroundimage decoding unit, which generates a restored gray alpha channel imageand a restored brightness and hue image by sequentially decoding grayalpha components and brightness and hue components of the current blockif the current block is classified as the foreground image portion; anda background image decoding unit, which generates a restored gray alphachannel image by decoding the gray alpha components of the current blockif the current block is classified as the background image portion.

According to another aspect of the present invention, there is provideda method of decoding an image containing a gray alpha channel image,which decodes a bitstream into which an image containing gray alphacomponents and brightness and hue components is encoded, the methodincluding: interpreting the bitstream in units of predetermined blocksand classifying a current block obtained as one of the interpretationresults either as a foreground image portion or as a background imageportion; generating a restored gray alpha channel image and a restoredbrightness and hue image by sequentially decoding gray alpha componentsand brightness and hue components of the current block if the currentblock is classified as the foreground image portion; and generating arestored gray alpha channel image by decoding the gray alpha componentsof the current block if the current block is classified as thebackground image portion.

According to another aspect of the present invention, the methods can beimplemented by a computer-readable recording medium having embodiedthereon a computer program for the methods.

BRIEF DESCRIPTION OF THE DRAWINGS

These and/or other aspects and advantages of the invention will becomeapparent and more readily appreciated from the following description ofthe embodiments, taken in conjunction with the accompanying drawings ofwhich:

FIGS. 1A and 1B are block diagrams of an apparatus for encoding an imagecontaining a gray alpha channel image according to an exemplaryembodiment of the present invention;

FIG. 2 is a detailed block diagram of the apparatus of FIG. 1B;

FIG. 3 is a flowchart of a method of encoding an image containing a grayalpha channel image according to an exemplary embodiment of the presentinvention;

FIGS. 4A and 4B are diagrams illustrating the structures of bitstreamsgenerated by the apparatus of FIG. 1A or 1B;

FIG. 5 is a diagram illustrating a method of generating a coded blockpattern (CBP) of a gray alpha channel component according to anexemplary embodiment of the present invention;

FIGS. 6A and 6B are block diagrams of an apparatus for decoding an imagecontaining a gray alpha channel image according to an exemplaryembodiment of the present invention;

FIG. 7 is a detailed block diagram of the apparatus of FIG. 6B;

FIG. 8 is a flowchart of a method of decoding an image containing a grayalpha channel image according to an exemplary embodiment of the presentinvention;

FIG. 9 is a diagram illustrating examples of the partitioning of amacroblock (MB) into a plurality of blocks for a temporal predictionoperation;

FIG. 10 is a diagram illustrating the locations of a set of pixels of acurrent block to be spatially predicted and pixels spatially adjacent tothe set of pixels of the current block;

FIG. 11 is a diagram illustrating an example of a gray alpha channelimage and whether each of a plurality of MBs of the gray alpha channelimage is transparent or opaque; and

FIG. 12 is a diagram illustrating an example of the synthesis of ageneral image and a gray alpha channel image.

DETAILED DESCRIPTION OF THE INVENTION

Reference will now be made in detail to the present embodiments of thepresent invention, examples of which are illustrated in the accompanyingdrawings, wherein like reference numerals refer to the like elementsthroughout. The embodiments are described below in order to explain thepresent invention by referring to the figures.

FIG. 1A is a block diagram of an apparatus for encoding an imagecontaining a gray alpha channel image according to an exemplaryembodiment of the present invention. Referring to FIG. 1A, the apparatusincludes a block data reception unit 101, a foreground image encodingunit 103, and a background image encoding unit 107.

The block data reception unit 101 receives image data of a frame(hereinafter referred to as a current frame) currently being input tothe apparatus in units of predetermined blocks, for example, in units ofmacroblocks (hereinafter referred to as MBs), and classifies thereceived blocks as either foreground image portions or background imageportions according to their respective gray alpha component values.

The foreground image encoding unit 103 sequentially encodes thebrightness and hue of each of the received blocks classified asforeground image portions.

The background image encoding unit 107 encodes gray alpha components ofthe received blocks classified as background image portions.

FIG. 1B is a detailed block diagram of the apparatus of FIG. 1A.Referring to FIG. 1B, the apparatus includes a block data reception unit111, a gray prediction error generation unit 113, a gray predictionerror encoding unit 115, a brightness and hue prediction errorgeneration unit 117, a brightness and hue prediction error encoding unit119, and a bitstream generation unit 121. The foreground image encodingunit 103 comprises the gray prediction error generation unit 113, a grayprediction error encoding unit 115, the brightness and hue predictionerror generation unit 117, the brightness and hue prediction errorencoding unit 119, and the bitstream generation unit 121. The backgroundimage encoding unit 105 comprises the gray prediction error generationunit 113, the gray prediction error encoding unit 115 and the bitstreamgeneration unit 121.

The block data reception unit 111 receives image data of a current framein units of predetermined blocks, for example, in units of MBs.Thereafter, the block data reception unit 111 provides gray alphacomponents of the received image data to the gray prediction errorgeneration unit 113 and provides brightness and hue components of thereceived image data to the brightness and hue prediction errorgeneration unit 117. Image data of one block is divided into gray alphacomponents, brightness components, and hue components. Gray alphacomponents of a block corresponding to a foreground image portion serveas weights for brightness and hue components of the block. For example,if a gray alpha component is represented by 8 bits, it may have a valuebetween 0 and 255. Gray alpha components serve as weights whensynthesizing a first brightness and hue image and a second brightnessand hue image. Thus, if the values of the gray alpha components arecloser to 255 than to 0, the first brightness and hue image is moreweighted than the second brightness and hue image when synthesized withthe second brightness and hue image. However, if the values of the grayalpha components are 0, the first brightness and hue image and thesecond brightness and hue image are synthesized with the firstbrightness and hue image being completely ignored. Boundary informationof a foreground image zone does not need to be encoded. If the values ofthe gray alpha components are 0, a corresponding block is considered asbeing a background image portion. Otherwise, the corresponding block isconsidered as being a portion of the foreground image zone. Sincebrightness and hue components are unnecessary in a background imagezone, they do not need to be encoded or decoded.

If a current block is of an intra mode, the gray prediction errorgeneration unit 113 performs a spatial prediction operation on grayalpha components of the current block with reference to gray alphacomponents of blocks that are spatially adjacent to the current blockand have already been restored. If the current block is of an intermode, the gray prediction error generation unit 113 performs a temporalprediction operation on the gray alpha components of the current blockwith reference to gray alpha components of a frame temporally previousto the current frame. As a result of the spatial or temporal predictionoperation, the gray prediction error generation unit 113 generates atemporal or spatial prediction image. Thereafter, the gray predictionerror generation unit 113 performs a temporal or spatial predictioncompensation operation on the temporal or spatial prediction image,thereby generating a compensated predicted image. Thereafter, the grayprediction error generation unit 113 generates gray prediction errors ofthe current block by subtracting gray alpha components of thecompensated predicted image from the respective gray alpha components ofthe current block. The gray prediction error generation unit 113compares a result of summing the absolute values of the gray predictionerrors of the current block with a predetermined critical value. If thesummation result is smaller than the predetermined critical value, thegray prediction error generation unit 113 skips the transforming,quantizing, and entropy-encoding the gray prediction errors of thecurrent block and provides the gray prediction errors of the currentblock directly to the bitstream generation unit 121 together withinformation indicating that the gray prediction errors of the currentblock have been exempted from being transformed, quantized, and encoded.However, if the summation result is larger than the predeterminedcritical value, the gray prediction error generation unit 113 providesthe gray prediction errors of the current block to the gray predictionerror encoding unit 115. In this type of method of generating grayprediction errors, any blocks can be exempted from being encodedregardless of whether they are of an inter mode or an intra mode.

The gray prediction error encoding unit 115 transforms, quantizes, andthen entropy-encodes the gray prediction errors of the current block andprovides the results to the bitstream generation unit 121.

If all of the gray alpha components of the current block have a value of0, in other words, if the current block is transparent, the brightnessand hue prediction error generation unit 117 provides them directly tothe bitstream generation unit 121 without the need to encode thebrightness and hue components of the current block. If the current blockis of an intra mode and is opaque, the brightness and hue predictionerror generation unit 117 performs a spatial prediction operation on thebrightness and hue components of the current block with reference tobrightness and hue components of blocks which are spatially adjacent tothe current block and have already been restored. On the other hand, ifthe current block is of an inter mode and is opaque, the brightness andhue prediction error generation unit 117 performs a temporal predictionoperation on the brightness and hue components of the current block withreference to brightness and hue components of the frame temporallyprevious to the current frame. As a result of the spatial or temporalprediction operation, the brightness and hue prediction error generationunit 117 generates a spatial or temporal prediction image. Thereafter,the brightness and hue prediction error generation unit 117 performs atemporal or spatial prediction compensation operation on the spatial ortemporal prediction image, thereby generating a compensated predictedimage. Thereafter, the brightness and hue prediction error generationunit 117 generates brightness and hue prediction errors of the currentblock by subtracting brightness and hue components of the compensatedpredicted image from the respective brightness and hue components of thecurrent block. If the gray prediction error generation unit 113 decidesto skip the encoding of the gray prediction errors of the current block,the brightness and hue prediction error generation unit 117 also decidesto skip the transforming, quantizing, and entropy-encoding of thebrightness and hue prediction errors of the current block and providesthe brightness and hue prediction errors of the current block directlyto the bitstream generation unit 121 to indicate that the brightness andhue prediction errors of the current block have been exempted from beingencoded. However, if the gray prediction error generation unit 113decides to encode the gray prediction errors of the current block, thebrightness and hue prediction error generation unit 117 provides thebrightness and hue prediction errors of the current block to thebrightness and hue prediction error encoding unit 119. In this type ofmethod of generating brightness and hue prediction errors, blocks of aninter mode can be exempted from being encoded.

The brightness and hue prediction error encoding unit 119 transforms,quantizes, and entropy-encodes the brightness and hue prediction errorsof the current block and provides the results to the bitstreamgeneration unit 121.

The bitstream generation unit 121 generates the received image data ofthe current frame into a bitstream that contains the gray predictionerrors and brightness and hue prediction errors of each of the blocks ofthe received image data of the current frame, type information, intra orinter prediction additional information, and coded block pattern (CBP)information of each of the blocks of the received image data of thecurrent frame, and information on whether the gray prediction errors andbrightness and hue prediction errors of each of the blocks of thereceived image data of the current frame have been exempted from beingencoded. The bitstream generated by the bitstream generation unit 121may have a structure of FIG. 4A or 4B.

FIG. 2 is a detailed block diagram illustrating the gray predictionerror generation unit 113 and the gray prediction error encoding unit115 of FIG. 1B. Referring to FIG. 2, the gray prediction errorgeneration unit 113 includes a temporal and spatial predictor 201, atemporal and spatial prediction compensator 203, a subtractor 205, aninverse quantizer and inverse transformer 207, an adder 209, and adeblocking filter 211. The gray prediction error encoding unit 115includes a transformer and quantizer 213 and an entropy encoder 215.

If a current block of a gray alpha channel image Fn (hereinafterreferred to as an original current gray alpha channel image) of thecurrent frame is of an intra mode, the temporal and spatial predictor201 generates a spatial prediction image by performing a spatialprediction operation on the current block with reference to a restoredgray alpha channel image F′n (hereinafter referred to as a currentrestored gray alpha channel image) of the current frame. If the currentblock is of an inter mode, the temporal and spatial predictor 201generates a temporal prediction image by performing a temporalprediction operation on the current block with reference to a restoredgray alpha channel image F′n−1 (hereinafter referred to as a previousrestored gray alpha channel image) of the previous frame.

The temporal and spatial prediction compensator 203 performs a temporalor spatial compensation operation on the temporal prediction image orthe spatial prediction image provided by the temporal and spatialpredictor 201, thereby generating a compensated predicted image.Thereafter, the temporal and spatial prediction compensator 203 providesthe compensated predicted image to the subtractor 205 and the adder 209.

The subtractor 205 generates gray prediction errors of the current blockby subtracting gray alpha components of the compensated predicted imagefrom the gray alpha components of the original current gray alphachannel image Fn. The subtractor 205 compares a result of summing theabsolute values of the gray prediction errors of the current block witha predetermined critical value and decides whether to set the grayprediction errors of the current block to 0 based on the comparisonresults. If the subtractor 205 decides to set all of the gray predictionerrors of the current block to 0, it provides them to the bitstreamgeneration unit 121 of FIG. 1 and the adder 209.

The inverse quantizer and inverse transformer 207 inversely quantizesand inversely transforms the gray prediction errors of the currentblock, which have been transformed and quantized by the transformer andquantizer 213, and provides the inversely quantized and inverselytransformed gray prediction errors of the current block to the adder209.

The adder 209 generates the current restored gray alpha channel imageF′n by adding the inversely quantized and inversely transformed grayprediction errors of the current block to the compensated predictedimage provided by the temporal and spatial prediction compensator 203.The current restored gray alpha channel image F′n is provided to thetemporal and spatial predictor 201, the temporal and spatial predictioncompensator 203, and the deblocking filter 211.

The deblocking filter 211 is used for deblocking the current restoredgray alpha channel image F′n provided by the adder 209. However, thedeblocking filter 211 is not necessarily required in the gray predictionerror generation unit 113.

The transformer and quantizer 213 transforms and quantizes the grayprediction errors of the current block provided by the subtractor 205and provide the transformation and quantization results to the entropyencoder 215. The transformer and quantizer 213 may transform the grayprediction errors of the current block using a discrete cosinetransformation (DCT) or integer transformation method.

The entropy encoder 215 entropy-encodes the transformed and quantizedgray prediction errors of the current block and provides theentropy-encoded gray prediction errors of the current block to thebitstream generation unit 121.

If the summation result is smaller than the predetermined criticalvalue, the entropy-encoding of the transformed and quantized grayprediction errors of the current block may be skipped regardless ofwhether the current block is of an inter mode or an intra mode.

The brightness and hue prediction error generation unit 117 and thebrightness and hue prediction error encoding unit 119 may have almostthe same structures as the gray prediction error generation unit 113 andthe gray prediction error encoding unit 115, respectively. However, theencoding of brightness and hue prediction errors of the current block isdifferent from the encoding of the gray prediction errors of the currentblock in that it may be skipped only if a result of summing the absolutevalues of the brightness and hue prediction errors of the current blockis smaller than a predetermined critical value and the current block isof an inter mode.

If the prediction errors of the current block have been exempted frombeing encoded, information indicating that the prediction errors of thecurrent block have been exempted from being encoded is included in abitstream corresponding to the current block without encoding pixelvalues of the current block. Accordingly, CBP information, motion vectorinformation, and the pixel values of the current block are not encoded.A restored image is obtained using a compensated predicted image ofblocks temporally or spatially adjacent to the current block, instead ofthe skipped prediction errors of the current block. For example, thelocation of a predetermined portion of a previous gray alpha channelimage is calculated using the values of pixels corresponding to thepredetermined portion of the previous gray alpha channel image or motionvectors of blocks adjacent to the current block, and the values of thepixels corresponding to the predetermined portion of the previous grayalpha channel image are used without the need to be processed.

FIG. 3 is a flowchart of a method of encoding an image containing a grayalpha channel image according to an exemplary embodiment of the presentinvention. Referring to FIG. 3, in operation 301, image data of acurrent frame is received in units of blocks. In operation 303, grayprediction errors of a current block are generated using gray alphacomponents of the current block by the gray prediction error generationunit 113.

In operation 305, a result of summing the absolute values of the grayprediction errors is compared by the subtractor 205 with a predeterminedcritical value. If the summation result is smaller than thepredetermined critical value, encoding of the gray prediction errors ofthe current block is skipped in operation 307.

In operation 309, it is determined whether all of the gray alphacomponents of the current block included the received image data have avalue of 0 (i.e., the current block is transparent). If all of the grayalpha components of the current block have a value of 0 (i.e., thecurrent block is transparent) encoding of brightness and hue componentsof the current block is skipped in operation 311.

In operation 313, if some of the gray alpha components of the currentblock have a value other than 0 (i.e., if the current block is opaque)the brightness and hue prediction errors of the current block aregenerated by the brightness and hue prediction error generation unit117.

In operation 315, encoding of the brightness and hue prediction errorsof the current block is skipped because the encoding of the grayprediction errors of the current block has been skipped in operation307.

If the summation result is larger than the predetermined critical valuein operation 305, the gray prediction errors of the current block areencoded in operation 317.

In operation 319, it is determined whether all of the gray alphacomponents of the current block included the received image data have avalue of 0 (i.e., the current block is transparent). If all of the grayalpha components of the current block have a value of 0 (i.e., thecurrent block is transparent) the encoding of the brightness and huecomponents of the current block is skipped in operation 321.

In operation 323, if some of the gray alpha components of the currentblock have a value other than 0 (i.e., if the current block is opaque)the brightness and hue prediction errors of the current block aregenerated by the brightness and hue error generation unit 117.

In operation 325, the brightness and hue prediction errors of thecurrent block are encoded by the brightness and hue prediction errorencoding unit 119 because the gray prediction errors of the currentblock have already been encoded in operation 317.

FIGS. 4A and 4B are diagrams illustrating the structures of bitstreamsgenerated by the apparatus of FIG. 1A or 1B. Specifically, FIG. 4Aillustrates a bitstream generated by the apparatus of FIG. 1A or 1B withintra or inter prediction additional information equally applied to grayalpha components and brightness and hue components of a current block.Referring to FIG. 4A, the bitstream includes a MB skip flag 411, an MBtype field 412, an intra or inter prediction additional informationfield 413, a gray CBP field 414, a gray prediction error field 415, abrightness and hue CBP field 416, a brightness prediction error field417, and a hue prediction error field 418. FIG. 4B illustrates abitstream generated by the apparatus of FIG. 1A or 1B with intra orinter prediction additional information applied to the gray alphacomponents of the current block independently of the brightness and huecomponents of the current block. Referring to FIG. 4B, the bitstreamincludes an MB skip flag 421, an MB type field 422, a gray intra orinter prediction additional information field 423, a gray CBP field 424,a gray prediction error field 425, a brightness and hue intra or interprediction additional information field 426, a brightness and hue CBPfield 427, a brightness prediction error field 428, and a hue predictionerror field 429.

The MB skip flags 411 and 421 are fields indicating whether the grayprediction errors, brightness prediction errors, and hue predictionerrors of the current block have been encoded. For example, if the MBskip flags 411 and 421 are set to 1, it appears that the encoding of thegray prediction errors, brightness prediction errors, and hue predictionerrors of the current block has been skipped, and thus, intra or interprediction additional information and the gray prediction errors,brightness prediction errors, and hue prediction errors of the currentblock are not encoded. Accordingly, the intra or inter predictionadditional information of the current block is obtained throughprediction from blocks adjacent to the current block, and the grayprediction errors, brightness prediction errors, and hue predictionerrors of the current block are set to 0. If the current block isdetermined to be transparent based on restored gray alpha information,the brightness and hue prediction errors of the current block do notexist regardless of the values of the MB skip flags 411 and 421 and thusdo not need to be encoded. Accordingly, it is possible to prevent thetotal amount of computations performed by the encoding and/or decodingapparatus from unnecessarily increasing.

The MB type fields 412 and 422 are fields indicating whether aprediction mode of the current block is an intra mode or an inter mode.According to the H.264 standard, the inter mode is classified into aplurality of sub-modes according to the size of blocks into which an MBis to be partitioned, and the intra mode is classified into a pluralityof sub-modes according to a prediction direction in which the values ofspatially adjacent pixels are predicted.

The intra or inter prediction additional information field 413, the grayintra or inter prediction additional information field 423, and thebrightness and hue intra or inter prediction additional informationfield 426 are fields containing motion vector information and intraprediction direction information. The gray CBP fields 414 and 424indicate CBPs of the gray alpha components of the current block, and thebrightness and hue CPB fields 416 and 427 indicate CBPs of thebrightness and hue components of the current block, and moreparticularly, indicate whether each 8×8 block has transformationcoefficients having a value other than 0.

FIG. 5 is a diagram illustrating a method of generating gray CBPsaccording to an exemplary embodiment of the present invention. Referringto FIG. 5, a 16×16 MB is partitioned into four 8×8 blocks, i.e., A, B,C, and D. If the blocks A, B, C, and D have been exempted from beingencoded, a value of 0 is allotted to each of the blocks A, B, C, and D.However, if the blocks A, B, C, and D have been encoded, a value of 1 isallotted to each of the blocks A, B, C, and D. Accordingly, it ispossible to indicate whether the encoding of each of the blocks A, B, C,and D has been skipped by allotting a value of 0 or 1 to each of theblocks A, B, C, and D.

FIG. 6A is a block diagram of an apparatus for decoding an imagecontaining a gray alpha channel image according to an exemplaryembodiment of the present invention. Referring to FIG. 6A, the apparatusincludes a bitstream interpretation unit 601, a foreground imagedecoding unit 603, and a background image decoding unit 605.

The bitstream interpretation unit 601 interprets a bitstream of each ofa plurality of block and classifies a corresponding block either as aforeground image portion or as a background image portion based on theinterpretation results.

The foreground image decoding unit 603 sequentially decodes brightnessand hue components of blocks classified as foreground image portions,thereby generating a restored gray alpha channel image and a restoredbrightness and hue image.

The background image decoding unit 605 decodes gray alpha components ofblocks classified as background image portions, thereby generating arestored gray alpha channel image.

FIG. 6B is a detailed block diagram of the apparatus of FIG. 6A.Referring to FIG. 6B, the apparatus includes a bitstream interpretationunit 611, a gray prediction error decoding unit 613, a gray alphacomponent restoration unit 615, a brightness and hue prediction errordecoding unit 617, and a brightness and hue component restoration unit619. The foreground image decoding unit 603 comprises the grayprediction error decoding unit 613, the gray alpha component restorationunit 615, the brightness and hue prediction error decoding unit 617, andthe brightness and hue component restoration unit 619. The backgroundimage decoding unit 605 comprises the gray prediction error decodingunit 613 and the gray alpha component restoration unit 615.

The bitstream interpretation unit 611 interprets an encoded bitstream ofa current block.

The gray prediction error decoding unit 613 determines whether grayprediction errors of the current block have been encoded with referenceto an MB skip flag 411 or 421 of the bitstream of the current block. Ifthe gray prediction errors of the current block have been encoded (e.g.,if the MB skip flag of the bitstream of the current block is set to 0)the gray prediction error decoding unit 613 decodes the gray predictionerrors of the current block. However, if the gray prediction errors ofthe current block have been exempted from being encoded (e.g., if the MBskip flag of the bitstream of the current block is set to 1) the grayprediction error decoding unit 613 predicts the decoded gray predictionerrors of the current block to be 0.

The gray alpha component restoration unit 615 determines whether aprediction mode of the current block is an intra mode or an inter modewith reference to an MB type field 412 or 422 of the bitstream of thecurrent block and generates a restored gray alpha channel image byadding the decoded gray prediction errors of the current block to aprediction image obtained by performing a temporal or spatial predictioncompensation operation on the decoded gray prediction errors of thecurrent block.

The brightness and hue prediction error decoding unit 617 determineswhether brightness and hue prediction errors of the current block havebeen encoded with reference to the MB skip flag 411 or 421 of thebitstream of the current block. If the brightness and hue predictionerrors of the current block have been encoded (e.g., if the MB skip flagof the bitstream of the current block is set to 0) the brightness andhue prediction error decoding unit 617 decodes the brightness and hueprediction errors of the current block. However, if the encoding of thebrightness and hue prediction errors of the current block has beenskipped (i.e., if the MB skip flag of the bitstream of the current blockis set to 1) the brightness and hue prediction error decoding unit 617predicts the decoded brightness and hue prediction errors of the currentblock to be 0.

The brightness and hue component restoration unit 619 determines whetherthe prediction mode of the current block is an intra mode or an intermode with reference to the MB type field 412 or 422 of the bitstream ofthe current block and generates a restored brightness and hue image byadding the decoded brightness and hue prediction errors of the currentblock to a prediction image obtained by performing a temporal or spatialprediction compensation operation on the decoded brightness and hueprediction errors of the current block.

FIG. 7 is a detailed block diagram illustrating the gray predictionerror decoding unit 613 and the gray alpha component restoration unit615 of FIG. 6B. Referring to FIG. 7, the gray prediction error decodingunit 613 includes an entropy decoder 701 and an inverse quantizer andinverse transformer 703, and the gray alpha component restoration unit615 includes an adder 705, a temporal and spatial prediction compensator707, and a deblocking filter 709.

If the interpretation results obtained by the bitstream interpretationunit 611 of FIG. 6B show that the MB skip flag 411 or 421 of thebitstream of the current block has a value of 0, the entropy decoder 701entropy-decodes the encoded gray prediction errors of the current block.If the interpretation results show that the MB skip flag 411 or 421 ofthe bitstream of the current block has a value of 1, the entropy decoder701 sets all of the gray prediction errors of the current block to 0 andprovides the setting results to the adder 705.

The inverse quantizer and inverse transformer 703 inversely quantizesand inversely transforms the entropy-decoded gray prediction errors ofthe current block and provides the inverse quantization and inversetransformation results to the adder 705.

The adder 705 generates a current restored gray alpha channel image F′nby adding the inversely quantization and inverse transformation resultsprovided by the inverse quantizer and inverse transformer 703 or thesetting results provided by the entropy decoder 701 to a compensatedtemporal or spatial prediction image.

The temporal and spatial prediction compensator 707 generates thecompensated temporal or spatial prediction image by performing atemporal or spatial prediction compensation on the current restored grayalpha channel image F′n or a previous restored gray alpha channel imageF′n−1, depending on whether the prediction mode is the inter or intramode, and provides the compensated temporal or spatial prediction imageto the adder 705.

The deblocking filter 709 is used for deblocking the current restoredgray alpha channel image F′n provided by the adder 705. However, thegray alpha component restoration unit 615 does not necessarily need toinclude the deblocking filter 709.

The structures of the gray prediction error decoding unit 613 and thegray alpha component restoration unit 615 of FIG. 7 can be directlyapplied to the structures of the brightness and hue prediction errordecoding unit 617 and the brightness and hue component restoration units619, respectively, of FIG. 6B.

FIG. 8 is a flowchart of a method of decoding an image containing a grayalpha channel image according to an exemplary embodiment of the presentinvention. Referring to FIG. 8, in operation 801, a bitstream of acurrent block is interpreted by the bitstream interpretation unit 611.

In operation 803, it is determined whether the encoding of grayprediction errors of the current block has been skipped with referenceto an MB skip flag of the bitstream of the current block.

In operation 805, if the encoding of the gray prediction errors of thecurrent block has been skipped, intra or inter prediction additionalinformation is restored by the gray component restoration unit 615 fromblocks temporally or spatially adjacent to the current block.

In operation 807, a gray prediction image is restored by the graycomponent restoration unit 615 using the restored intra or interprediction additional information. In operation 809, gray alphacomponents of the current block are restored by the gray componentrestoration unit 615 using the restored gray prediction image.

In operation 811, it is determined whether all of the gray alphacomponents of the current block restored in operation 809 are set to 0.In operation 813, if all of the gray alpha components of the currentblock are set to 0, decoding of brightness and hue components of thecurrent block is skipped. However, if some of the gray alpha componentsof the current block are set to a value other than 0, a brightness andhue prediction image is compensated for in operation 815. In operation817, brightness and hue components of the current block are restored bythe brightness and hue component restoration unit 619 by adding decodedbrightness and hue prediction errors to the compensated brightness andhue prediction image.

In operation 819, if the gray prediction errors of the current block aredetermined in operation 803 to have been encoded, the gray predictionimage is compensated for by the gray prediction error decoding unit 613.In operation 821, the gray alpha components of the current block arerestored by the gray component restoration unit 615 by adding decodedgray prediction errors to the compensated gray prediction image.

In operation 823, it is determined whether all of the gray alphacomponents of the current block restored in operation 821 are set to 0.In operation 825, if all of the restored gray alpha components of thecurrent block are set to 0, the decoding of the brightness and huecomponents of the current block is skipped. However, if some of therestored gray alpha components of the current block are set to a valueother than 0, the brightness and hue prediction image of the currentblock is compensated for in operation 827 by the brightness and huecomponent restoration unit 619. In operation 829, the brightness and huecomponents of the current block are restored by adding the non-decodedbrightness and hue prediction errors of the current block to thecompensated brightness and hue prediction image.

Table 1 below shows different methods of encoding an image containing agray alpha channel image performed by the apparatus for encoding animage containing a gray alpha channel image according to an exemplaryembodiment of the present invention in different encoding modes (i.e.,in encoding modes 1 through 4). TABLE 1 GRAY ALPHA ENCODING COMPONENTSMODE MB SKIP OF MB ENCODING METHOD 1 SKIPPED (1) OPAQUE (1) SKIPENCODING OF BRIGHTNESS AND HUE PREDICTION ERRORS SKIP ENCODING OF GRAYPREDICTION ERRORS 2 SKIPPED (1) TRANSPARENT (0) SKIP ENCODING OFBRIGHTNESS AND HUE COMPONENTS SKIP ENCODING OF GRAY PREDICTION ERRORS 3NON-SKIPPED OPAQUE (1) ENCODE BRIGHTNESS AND HUE (0) PREDICTION ERRORSENCODE GRAY PREDICTION ERRORS 4 NON-SKIPPED TRANSPARENT (0) SKIPENCODING OF BRIGHTNESS AND (0) HUE COMPONENTS ENCODE GRAY PREDICTIONERRORS

Referring to Table 1, a current block is classified either as aforeground image portion or as a background image portion depending onwhether the current block includes gray alpha components having a valueother than 0. If gray alpha components of the current block do notinclude a value other than 0 (i.e., the gray alpha components of thecurrent block are all 0, it is considered as being a background imageportion). Thus, encoding of brightness and hue components of the currentblock is skipped, but encoding of the gray alpha components of thecurrent block is performed. If a result of summing gray predictionerrors of the current block is smaller than a predetermined criticalvalue, encoding of the gray prediction errors of the current block isskipped. However, if the summation result is larger than thepredetermined critical value, the gray prediction errors of the currentblock are transformed, quantized, and entropy-encoded.

If gray alpha components of the current block include a value other than0, it is considered as being a foreground image portion. Thus, thebrightness and hue components of the current block as well as the grayalpha components of the current block are encoded. However, if thesummation result is smaller than the predetermined critical value, theencoding of the gray prediction errors and brightness and hue predictionerrors of the current block is skipped. If the summation result islarger than the predetermined critical value, the gray prediction errorsand brightness and hue prediction errors of the current block aretransformed, quantized, and entropy-encoded.

FIG. 9 is a diagram illustrating examples of a method of partitioning aMB into a plurality of blocks for a temporal prediction operation. TheMB partitioning method illustrated in FIG. 9 is defined in the ISO/IEC14496-10 and ITU-T Rec. H.264 standards. In the MB partitioning methodof FIG. 9, a 16×16 MB may be used as is or is partitioned into a pair of16×8 blocks, a pair of 8×16, or two pairs of 8×8 blocks and istemporally predicted using a motion vector of each of the blocks intowhich it is partitioned. An 8×8 block can be used as is or can besub-partitioned into a pair of 8×4 blocks, a pair of 4×8 blocks, or twopairs of 4×4 blocks, thus enabling detailed motions to be preciselydetected.

In a temporal prediction operation, a previous alpha channel image maybe two or four times enlarged, and then motion estimation is performedon the enlarged previous alpha channel image in units of half-pixels orquarter-pixels. In order to enlarge the previous alpha channel image, abi-linear interpolation method may be used in an MPEG-4 approach, or a 6tap filter-based interpolation method may be used in an H.264 approach.However, in order to reduce the amount of computation required forprocessing a gray alpha channel image, such motion estimation processmay be skipped. Alternatively, such motion estimation process may beperformed using one of the interpolation methods mentioned above oranother interpolation method that can lead to a reduction in the totalamount of computation required for processing a gray alpha channelimage.

FIG. 10A illustrates the locations of a set of pixels of a current blockto be spatially predicted and pixels spatially adjacent to the set ofpixels. A spatial prediction method illustrated in FIG. 10A is definedin the ISO/IEC 14496-10 and ITU-T Rec. H.264 standards. In the spatialprediction method of FIG. 10A, the values of pixels Pa, Pb, . . . , andPq of a 4×4 block are spatially predicted using the values of pixels P1,P2, . . . , and P12 which are spatially adjacent to the pixels Pa, Pb,and Pq and have already been encoded and then restored.

FIG. 10B illustrates a total of 9 prediction directions (i.e., zerothrough eighth prediction directions) in which the set of pixels of thecurrent block are spatially predicted through projection of pixelsspatially adjacent to the set of pixels of the current block. Referringto FIG. 10B, the values of the pixels Pa, Pe, Pi, and Pm are predictedby projecting the pixel P1 in the zero prediction direction, the valuesof the pixels Pb, Pf, Pj, and Pn are predicted by projecting the pixelP2 in the zero prediction direction, the values of the pixels Pc, Pg,Pk, and Po are predicted by projecting the pixel P3 in the zeroprediction direction, and the values of the pixels Pd, Ph, Pl, and Pqare predicted by projecting the pixel P4 in the zero predictiondirection. In this manner, the pixels Pa, Pb, . . . , and Pq arepredicted by projecting the pixels P1, P2, . . . , and P12 in each ofthe zero through eighth prediction directions.

The temporal and spatial prediction methods illustrated in FIGS. 9 and10A and 10B, respectively, have been described above as being based onexisting standard techniques but are not restricted to them.

FIG. 11 is a diagram illustrating an example of a gray alpha channelimage and whether each of a plurality of MBs of the gray alpha channelimage 1101 is transparent or opaque. Referring to FIG. 11, MBsillustrated in image 1102 having a value of 1 are transparent, and MBshaving a value of 0 are opaque. Image 1102 is a bit value representationof the image 1101. The MBs having a value of 1 are classified asbackground image portions. Thus, gray alpha components of each of theMBs having a value of 1 are restored through encoding and decodingoperations. However, the MBs having a value of 1 do not have brightnessand hue components and thus is exempted from a brightness and huecomponent encoding operation. The gray alpha components of each of theMBs of the gray alpha channel image are encoded and decoded through anintra- or inter-prediction compensation operation regardless of whethera corresponding MB is transparent or opaque. However, the MBs having avalue of 0 are classified as foreground image portions and thus, theyhave brightness and hue components. Therefore, the MBs having a value of1 are encoded and then decoded through an intra- or inter-predictioncompensation operation.

FIG. 12 is a diagram illustrating an example of the synthesis of animage containing a gray alpha channel image with an image having anarbitrary brightness and hue component. Referring to FIG. 12, referencenumeral 1201 represents a foreground image zone having brightness andhue components, and reference numeral 1202 represents a gray alphachannel image for the foreground image zone 1201. The foreground imagezone 1201 is synthesized with an image 1203 having an arbitrarybrightness and hue component using the gray alpha channel image 1202,thereby generating a synthesized image 1204. This method of synthesizingthe foreground image zone 1201 with the image 1203 may be used togenerate a new background image in the process of editing broadcastcontent. Supposing that Nyuv, Na, Myuv, and Pyuv represent a brightnessand hue component of the foreground image zone 1201, a gray alphacomponent of the foreground image zone 1201, a brightness and huecomponent of the image 1203, and a brightness and hue component of thesynthesized image 1204, respectively, the brightness and hue componentPyuv of the synthesized image 1204 can be obtained using Equation (1):$\begin{matrix}{P_{yuv} = {\frac{{\left( {2^{n} - 1 - N_{\alpha}} \right) \times M_{yuv}} + \left( {N_{\alpha} \times N_{yuv}} \right)}{2^{n} - 1}.}} & (1)\end{matrix}$

The gray alpha component Na of the foreground image zone 1201 isrepresented by n bits. For example, if the gray alpha component Na ofthe foreground image zone 1201 is represented by 8 bits, it may have avalue between 0 and 255. The gray alpha component Na of the foregroundimage 1201 is used as a weight in averaging the brightness and huecomponent Nyuv of the foreground image zone 1201 and the brightness andhue component Myuv of the image 1203. Accordingly, if the gray alphacomponent Na of the foreground image zone 1201 has a value of 0, acorresponding portion of the foreground image zone 1201 is considered asbeing a background image portion. Thus, the gray alpha component Na ofthe foreground image zone 1201 does not affect the synthesized image1204 regardless of the value of the brightness and hue component Nyuv ofthe foreground image zone 1201.

The present invention can be realized as computer-readable codes writtenon a computer-readable recording medium. The computer-readable recordingmedium includes nearly all kinds of recording devices on which data canbe stored in a computer-readable manner. Examples of thecomputer-readable recording medium include a ROM, a RAM, a CD-ROM, amagnetic tape, a floppy disc, an optical data storage, and a carrierwave (e.g., the transmission of data through the Internet). Thecomputer-readable recording medium can be distributed over a pluralityof computer systems connected to a network so that the computer-readablecodes can be stored and executed in a decentralized manner. A functionalprogram, codes, and code segments necessary for realizing theembodiments of the present invention can be easily deduced by one ofordinary skill in the art.

As described above, according to aspects of the present invention, agray alpha component is used as a weight when synthesizing two imagesand also serves as a mask for separating a foreground image zone of eachof the images from a background image zone of a corresponding image.Thus, there is no need to encode or decode binary data for separatingthe foreground and background image zones of the corresponding imagefrom each other, thus considerably enhancing the entire encodingefficiency and reducing the complexity of the synthesizing of theimages.

In addition, according to aspects of the present invention, it ispossible to more considerably enhance the entire encoding efficiency bydetermining whether to encode a brightness and hue component of thebackground image zone of each of the images based on whether the imagesinclude gray alpha components. Moreover, it is possible to moreconsiderably reduce the complexity of synthesizing of the images bydetermining whether to decode the brightness and hue component of thebackground image zone of each of the images based on a result ofdecoding the gray alpha channel components of each of the images.

Furthermore, it is possible to even more considerably enhance the entireencoding efficiency by setting an MB skip flag for a gray alphacomponent to 1 and thus preventing unnecessary encoding of predictionadditional information and prediction errors in an intra predictionmode.

An image containing a gray alpha channel image can be encoded or decodedindependently of other typical images not containing a gray alphachannel image, and the apparatus for encoding and decoding an imagecontaining a gray alpha channel image according to the present inventionis compatible with existing standard techniques, for example,H.264-based techniques. Thus, it is possible to achieve a high encodingefficiency with a small amount of computation.

Aspects of the present invention are applicable to an image containing abinary alpha channel image as well as an image containing a gray alphachannel image. In other words, in the case of encoding or decoding animage containing a binary alpha channel image in units of MBs,brightness and hue components of each of the MBs of the image data maynot be encoded or decoded if a corresponding MB is determined to belongto a background image zone of the image data. Therefore, it is possibleto enhance the efficiency of encoding the image data and reduce theamount of computation required for encoding the image data.

Although a few embodiments of the present invention have been shown anddescribed, it would be appreciated by those skilled in the art thatchanges may be made in this embodiment without departing from theprinciples and spirit of the invention, the scope of which is defined inthe claims and their equivalents.

1. An apparatus to encode an image containing a gray alpha channelimage, the apparatus encodes the image including gray alpha componentsand brightness and hue components in units of predetermined blocks, theapparatus comprising: a block data reception unit which receives imagedata of a block currently being input to the apparatus and classifiesthe current block either as a foreground image portion or as abackground image portion according to the values of the gray alphacomponents in the current block; a foreground image encoding unit whichsequentially encodes the gray alpha components and the brightness andhue components of the current block if the current block is classifiedas the foreground image portion; and a background image encoding unitwhich encodes the gray alpha components of the current block if thecurrent block is classified as the background image portion.
 2. Theapparatus of claim 1, wherein the foreground image encoding unitcomprises: a gray prediction error generation unit which generates grayprediction errors of the current block; a gray prediction error encodingunit which decides whether to encode the generated gray predictionerrors of the current block based on a result of comparing the generatedgray prediction errors of the current block with a predeterminedcritical value; a brightness and hue prediction error generation unitwhich generates brightness and hue prediction errors of the currentblock; a brightness and hue prediction error encoding unit which decideswhether to encode the generated brightness and hue prediction errors ofthe current block based on the result of the comparing of the grayprediction errors of the current block with the predetermined criticalvalue; and a bitstream generation unit which generates a bitstream basedon the comparing results obtained by the gray prediction error encodingunit and the comparing results obtained by the brightness and hueprediction error encoding unit.
 3. The apparatus of claim 1, wherein thebackground image encoding unit comprises: a gray prediction errorgeneration unit which generates gray prediction errors of the currentblock; a gray prediction error encoding unit which decides whether toencode the generated gray prediction errors of the current block basedon a result of comparing the gray prediction errors of the current blockwith a predetermined critical value; and a bitstream generation unitwhich generates a bitstream based on the comparing results obtained bythe gray prediction error encoding unit.
 4. The apparatus of claim 2,wherein the gray prediction error encoding unit skips the encoding ofthe generated gray prediction errors of the current block regardless ofa prediction mode of the current block if each of the generated grayprediction errors of the current block is smaller than the predeterminedcritical value.
 5. The apparatus of claim 2, wherein the brightness andhue prediction error generation unit skips the encoding of generated thebrightness and hue components of the current block if all of the grayalpha components of the current block have a value of
 0. 6. Theapparatus of claim 2, wherein the brightness and hue prediction errorencoding unit skips the encoding of the generated brightness and hueprediction errors of the current block if each of the gray predictionerrors of the current block is smaller than the predetermined criticalvalue and a prediction mode of the current block is an inter mode. 7.The apparatus of claim 3, wherein the gray prediction error encodingunit skips the encoding of the generated gray prediction errors of thecurrent block regardless of a prediction mode of the current block ifeach of the generated gray prediction errors of the current block issmaller than the predetermined critical value.
 8. A method of encodingan image containing a gray alpha channel image, which encodes an imageincluding gray alpha components and brightness and hue components inunits of predetermined blocks, the method comprising: classifying acurrent block either as a foreground image portion or as a backgroundimage portion according to values of the gray alpha components in thecurrent block; sequentially encoding the gray alpha components and thebrightness and hue components of the current block if the current blockis classified as the foreground image portion; and encoding the grayalpha components of the current block if the current block is classifiedas the background image portion.
 9. The method of claim 8, wherein theclassifying of the current block, comprises classifying the currentblock as the foreground image portion if all of the gray alphacomponents of the current block have a value of 0 and classifying thecurrent block as the background image portion otherwise.
 10. The methodof claim 8, wherein the sequentially encoding of the gray alphacomponents and the brightness and hue components of the current block isskipped if each of the gray alpha components of the current block issmaller than a predetermined critical value.
 11. The method of claim 10,wherein the encoding of the gray alpha components of the current blockis skipped regardless of a prediction mode of the current block when thecurrent block is classified as the background image portion.
 12. Themethod of claim 10, wherein the sequentially encoding of the gray alphacomponents and the brightness and hue components of the current block isskipped if a prediction mode of the current block is an inter mode. 13.The method of claim 8, wherein the encoding of the gray alpha componentsof the current block is skipped if each of the gray alpha components ofthe current block is smaller than a predetermined critical value. 14.The method of claim 13, wherein the encoding of the gray alphacomponents of the current block is skipped regardless of a predictionmode of the current block.
 15. An apparatus to decode an image includinga gray alpha channel image, which decodes a bitstream into which animage including gray alpha components and/or brightness and huecomponents is encoded, the apparatus comprising: a bitstreaminterpretation unit which interprets the bitstream in units ofpredetermined blocks and classifies a current block obtained as one ofthe interpretation results either as a foreground image portion or as abackground image portion; a foreground image decoding unit whichgenerates a first restored gray alpha channel image and a restoredbrightness and hue image by sequentially decoding the gray alphacomponents and the brightness and hue components of the current block ifthe current block is classified as the foreground image portion; and abackground image decoding unit which generates a second restored grayalpha channel image by decoding the gray alpha components of the currentblock if the current block is classified as the background imageportion.
 16. The apparatus of claim 15, wherein the foreground imagedecoding unit comprises: a gray prediction error decoding unit whichdecodes gray prediction errors corresponding to the encoded gray alphacomponents of the current block; a gray alpha component restoration unitwhich restores the gray alpha channel image from the decoded grayprediction errors; a brightness and hue prediction error decoding unitwhich decodes brightness and hue prediction errors corresponding to theencoded brightness and hue components of the current block; and abrightness and hue component restoration unit which restores thebrightness and hue image from the decoded brightness and hue predictionerrors.
 17. The apparatus of claim 15, wherein the background imagedecoding unit comprises: a gray prediction error decoding unit whichdecodes gray prediction errors corresponding to the encoded gray alphacomponents of the current block; and a gray alpha component restorationunit which restores the gray alpha channel image from the decoded grayprediction errors.
 18. The apparatus of claim 16, wherein the grayprediction error decoding unit decodes the gray prediction errors of thecurrent block as 0 if the gray prediction errors of the current blockhave not been encoded in the gray alpha components of the current block.19. The apparatus of claim 16, wherein the brightness and hue predictionerror decoding unit skips the decoding of the encoded brightness and huecomponents of the current block if the brightness and hue components ofthe current block have not been encoded in the image.
 20. The apparatusof claim 19, wherein the brightness and hue prediction error decodingunit decodes the brightness and hue components of the current block as 0if the brightness and hue components of the current block have not beenencoded in the image.
 21. The apparatus of claim 17, wherein the grayprediction error decoding unit decodes gray prediction errors from theencoded gray alpha components of the current block as 0 if the grayprediction errors of the current block have not been encoded.
 22. Amethod of decoding an image including a gray alpha channel image, whichdecodes a bitstream into which an image including gray alpha componentsand brightness and hue components is encoded, the method comprising:interpreting the bitstream in units of predetermined blocks andclassifying a current block obtained as one of the interpretationresults either as a foreground image portion or as a background imageportion; generating a first restored gray alpha channel image and arestored brightness and hue image by sequentially decoding the grayalpha components and the brightness and hue components of the currentblock if the current block is classified as the foreground imageportion; and generating a second restored gray alpha channel image bydecoding the gray alpha components of the current block if the currentblock is classified as the background image portion.
 23. The method ofclaim 22, wherein the generating the first restored gray alpha channelimage and the restored brightness and hue image comprise decoding grayprediction errors and brightness and hue prediction errors of thecurrent block from the gray alpha components and the brightness and huecomponents, respectively, as 0 if the gray prediction errors and thebrightness and hue prediction errors have not been encoded in the image.24. The method of claim 22, wherein the generating the second restoredgray alpha channel image comprises decoding gray prediction errors ofthe current block from the gray alpha components as 0 if the grayprediction errors have not been encoded in the image.
 25. Acomputer-readable recording medium storing a computer program forexecuting a method of encoding an image containing a gray alpha channelimage, which encodes an image including gray alpha components andbrightness and hue components in units of predetermined blocks, themethod comprising: classifying a current block either as a foregroundimage portion or as a background image portion according to values ofthe gray alpha components in the current block; sequentially encodingthe gray alpha components and the brightness and hue components of thecurrent block if the current block is classified as the foreground imageportion; and encoding the gray alpha components of the current block ifthe current block is classified as the background image portion.
 26. Acomputer-readable recording medium storing a computer program forexecuting a method of decoding an image including a gray alpha channelimage, which decodes a bitstream into which an image including grayalpha components and brightness and hue components is encoded, themethod comprising: interpreting the bitstream in units of predeterminedblocks and classifying a current block obtained as one of theinterpretation results either as a foreground image portion or as abackground image portion; generating a first restored gray alpha channelimage and a restored brightness and hue image by sequentially decodingthe gray alpha components and the brightness and hue components of thecurrent block if the current block is classified as the foreground imageportion; and generating a second restored gray alpha channel image bydecoding the gray alpha components of the current block if the currentblock is classified as the background image portion.
 27. A method ofprocessing an image, comprising: parsing the image in blocks;determining whether one of the blocks belongs to a background zone ofthe image or a foreground zone of the image; and processing the one ofthe blocks according to the determination of the one of the blocksbelonging to the background zone or the foreground zone, whereinbrightness and hue components of the one of the blocks of the image aredetermined only when the one of the blocks is in the foreground zone.28. The method of claim 27, wherein the image includes a binary alphachannel image.
 29. The method of claim 27, further comprising:generating a skip flag to indicate whether the one of the blocks isprocessed such that unnecessary processing is prevented.
 30. The methodof claim 27, wherein the image includes a gray alpha channel image. 31.The method of claim 30, wherein the processing the one of the blockscomprises: weighting a first brightness and hue component of the imageusing gray alpha components of the gray alpha channel image; andsynthesizing the first brightness and hue component of the image with asecond brightness and hue component of a second image according to thegray alpha components.
 32. The method of claim 30, wherein theprocessing the one of the blocks comprises: generating gray predictionerrors of the one of the blocks based on a comparison of predicted grayalpha components of a temporally or spatially predicted block and thegray alpha components of the one of the blocks; encoding the generatedgray prediction errors of the one of the blocks if the generated grayprediction errors exceed a threshold; and encoding the brightness andhue components of the one of the blocks when the one of the blocks isopaque.
 33. The method of claim 32, wherein the processing the one ofthe blocks comprises: determining if the generated gray predictionerrors of the one of the blocks is encoded; restoring the gray alphachannel image by decoding the gray prediction errors if the grayprediction errors are determined as encoded; restoring the gray alphachannel image by generating compensation information for the gray alphachannel image by predicting information by using another of the blockstemporally or spatially adjacent the one of the blocks; restoring thebrightness and hue components of the image when the one of the blocks isopaque.
 34. A method of synthesizing images, comprising: determiningwhether to encode a brightness and hue component of a background imagezone of each image according to whether the images include gray alphacomponents.
 35. A method of reducing computation required to encodeimages, comprising: parsing each of the images into a plurality ofblocks; and encoding brightness and hue components of a particular blockof the plurality of blocks of each image only when the particular blockis in a foreground zone of each of the images.